/*    */ package eos.moe.dragoncore;
/*    */ 
/*    */ import javax.vecmath.Vector2f;
/*    */ import net.minecraft.client.Minecraft;
/*    */ import net.minecraft.client.gui.ScaledResolution;
/*    */ import net.minecraft.client.renderer.Matrix4f;
/*    */ import net.minecraft.client.renderer.culling.ClippingHelperImpl;
/*    */ import net.minecraft.util.math.Vec3d;
/*    */ import org.lwjgl.util.vector.Matrix4f;
/*    */ import org.lwjgl.util.vector.Vector3f;
/*    */ import org.lwjgl.util.vector.Vector4f;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class jw
/*    */ {
/*    */   public static Vector2f v(Vec3d a) {
/* 19 */     Matrix4f matrix4f = new Matrix4f((ClippingHelperImpl.func_78558_a()).field_78554_d);
/* 20 */     Vector4f vector4f1 = new Vector4f((float)a.field_72450_a, (float)a.field_72448_b, (float)a.field_72449_c, 1.0F);
/* 21 */     Vector4f vector4f2 = Matrix4f.transform((Matrix4f)matrix4f, vector4f1, null);
/* 22 */     if (vector4f2.w == 0.0F) {
/* 23 */       return null;
/*    */     }
/*    */     
/* 26 */     Vector3f vector3f = new Vector3f();
/* 27 */     vector3f.x = vector4f2.x / vector4f2.w;
/* 28 */     vector3f.y = vector4f2.y / vector4f2.w;
/* 29 */     vector3f.z = vector4f2.z / vector4f2.w;
/*    */     
/* 31 */     Vector2f vector2f = new Vector2f();
/* 32 */     ScaledResolution scaledResolution = new ScaledResolution(Minecraft.func_71410_x());
/* 33 */     vector2f.x = (float)z(vector3f.x, scaledResolution.func_78327_c());
/* 34 */     vector2f.y = (float)v(vector3f.y, scaledResolution.func_78324_d());
/* 35 */     return vector2f;
/*    */   }
/*    */   
/*    */   public static double z(double a, double d1) {
/* 39 */     if (a < 0.0D)
/* 40 */       return d1 * (1.0D - -a); 
/* 41 */     if (a > 0.0D) {
/* 42 */       return d1 * a;
/*    */     }
/* 44 */     return d1 * 0.5D;
/*    */   }
/*    */ 
/*    */   
/*    */   public static double v(double a, double d1) {
/* 49 */     if (a < 0.0D)
/* 50 */       return d1 * -a; 
/* 51 */     if (a > 0.0D) {
/* 52 */       return d1 * (1.0D - a);
/*    */     }
/* 54 */     return d1 * 0.5D;
/*    */   }
/*    */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\jw.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */